package com.sl.biz.modular.std.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sl.biz.modular.std.dao.domain.entity.StandardFieldConfigDO;
import com.sl.biz.modular.std.dao.service.StandardFieldConfigDaoService;
import com.sl.biz.modular.std.service.StandardFieldConfigBizService;
import com.sl.common.page.CommonPageRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class StandardFieldConfigBizServiceImpl implements StandardFieldConfigBizService {
    private final StandardFieldConfigDaoService standardFieldConfigDaoService;

    @Override
    public Page<StandardFieldConfigDO> page() {
        LambdaQueryWrapper<StandardFieldConfigDO> queryWrapper = new LambdaQueryWrapper<>();
        Page<StandardFieldConfigDO> page = standardFieldConfigDaoService.page(CommonPageRequest.defaultPage(), queryWrapper);
        return page;

    }

    @Override
    public Boolean add(StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigDaoService.save(standardFieldConfigDO);
    }

    @Override
    public Boolean updateById(StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigDaoService.updateById(standardFieldConfigDO);
    }

    @Override
    public Boolean removeById(StandardFieldConfigDO standardFieldConfigDO) {
        return standardFieldConfigDaoService.removeById(standardFieldConfigDO.getId());
    }
}
